// 获取封面背景节点
var imgBoxNode = document.querySelector(".imgBox");
// 获取section2背景
var section2BgNode = document.querySelector(".section2bg");
// 获取关于我们背景
var aboutMe = document.querySelector(".aboutMeBg");
// 获取关于我们按钮
var aboutMeBtnNode = document.querySelector(".aboutMeBtn");
// 获取顶部导航栏
var headNav = document.querySelector(".headNav");
// 获取section2
var section2 = document.querySelector(".section2");
// 获取浏览器分辨率宽度
var screenWidth = screen.width;
// 获取浏览器分辨率高度
var screenHeight = screen.availHeight;
// 低分率下展开按钮
var hideShowBtnNode = document.querySelector(".hideShowBtn");
// 低分率展开面板
var hideShowNode = document.querySelector(".hideShow");
// 获取求职意向节点
var occIntentionBoxNode = document.querySelector(".occIntentionBox");
// 获取顶部导航下的所有Li
var NavLiNode = document.querySelectorAll(".container> ul > .row > li");
// 获取技术掌握栏节点
var techBoxNode = document.querySelector(".techBox");
// 获取我的经历节点
var experienceBoxNode = document.querySelector(".experienceBox");
// 获取联系我节点
var contactBoxNode = document.querySelector(".contactBox");
// 获取滚动

// 定时器名
var btns = false;
var timer = null;
var count = 1;
   
// 封面背景图片列表
var imgList=[
    bg1 = "../img/bg5.jpeg",
    bg2 = "../img/bg6.jpeg",
    bg3 = "../img/bg7.jpeg",
    bg4 = "../img/bg4.jpeg"
]


// 封面背景方法
var indexBg = function(){
    // innerBgNode.style.width = screenWidth + "px";
    imgBoxNode.style.height = screenHeight + "px";
    imgBoxNode.style.backgroundImage = "url(img/bg5.jpeg)";
    imgBoxNode.style.transformOrigin = "center center "+(-(screenWidth))
    timer = setInterval(fun,10000)
    function  fun() { 
        if(count>3){
            count =0
        }
        imgBoxNode.style.backgroundImage = "url("+imgList[count]+")";
        count++;
     }
}()

// 底层背景方法
var bgDown = function(){
    aboutMe.style.height = screenHeight*2+"px";
    aboutMe.style.backgroundImage = "url(img/aboutUsBg.jpeg)";
    section2BgNode.style.height = screenHeight*2+"px";
    section2BgNode.style.backgroundImage = "url(img/bg2bg.jpeg)";
    section2BgNode.style.top = screenHeight*3+"px";
}()

//顶部导航栏的定位方法
var headNavPos = function () {
    section2.style.height = screenHeight+"px";
 }()
 
// 求职意向栏
var occIntentionBox = function(){
    occIntentionBoxNode.style.height = screenHeight+"px";
}()

// 技术掌握栏
var techBox = function(){
    techBoxNode.style.height = screenHeight+"px"
}()
// 我的经历栏
var experienceBox = function(){
    experienceBoxNode.style.height = screenHeight+"px"
}()
// 联系我栏
var contactBox = function(){
    contactBoxNode.style.height = screenHeight+"px"
}()
//  低分率的展开按钮点击事件
hideShowBtnNode.addEventListener("click",over,false)
function over(){
    btns = !btns;
    if(btns){
        hideShowNode.style.display = "block"
    }else{
        hideShowNode.style.display = "none"
    }
}
// 关于我按钮点击方法
aboutMeBtnNode.addEventListener("click",function(){
    wrap.scrollTo(0,screenHeight)
    console.log(123)
},false)
// 导航栏点击滚动条跳转事件
var navClick = function(){
    NavLiNode[0].onclick = function () {
        clearStyles(NavLiNode)
        wrap.scrollTo(0,screenHeight)
        NavLiNode[0].style.color = "orange";

     }
     NavLiNode[1].onclick = function () { 
        clearStyles(NavLiNode,"white")
        wrap.scrollTo(0,screenHeight*2)
        NavLiNode[1].style.color = "orange";
     }
     NavLiNode[2].onclick = function () { 
        clearStyles(NavLiNode,"white")
        wrap.scrollTo(0,screenHeight*3)
        NavLiNode[2].style.color = "orange";
     }
     NavLiNode[3].onclick = function () { 
        clearStyles(NavLiNode,"white")
        wrap.scrollTo(0,screenHeight*4)
        NavLiNode[3].style.color = "orange";
     }
     NavLiNode[4].onclick = function () { 
        clearStyles(NavLiNode,"white")
        wrap.scrollTo(0,screenHeight*5+5)
        NavLiNode[4].style.color = "orange";
     }
}()
// 清楚导航栏字体颜色方法
function clearStyles(Eles){
    for(var i=0;i<Eles.length;i++){
        Eles[i].style.color = "white";
    } 
}
//  滚动事件
